package com.game.commons.concurrent.taskmanager;

import java.util.concurrent.locks.ReentrantReadWriteLock;

/**
 * 
 * @author 杜祥
 * @create 2013-6-5
 */
public abstract class AbstractLockManager 
{
	private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
	
	private final ReentrantReadWriteLock.ReadLock readLock = lock.readLock();
	
	private final ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock();
	
	
	public final void writeLock()
	{
		writeLock.lock();
	}
	
	
	public final void writeUnLock()
	{
		writeLock.unlock();
	}
	
	
	public final void readLock()
	{
		readLock.lock();
	}
	
	
	public final void readUnlock()
	{
		readLock.unlock();
	}
}
